//
//  XMGFoundInMessageVC.m
//  weibo
//
//  Created by apple on 16/7/5.
//  Copyright © 2016年 DP. All rights reserved.
//

#import "XMGFoundInMessageVC.h"

@interface XMGFoundInMessageVC ()

@end

@implementation XMGFoundInMessageVC

- (void)viewDidLoad {
    [super viewDidLoad];
    
#pragma mark - 自定义发现群页面的导航栏barButtonItem
    UIButton *btn =  [[UIButton alloc] init];
    
    [btn setImage:[UIImage imageNamed:@"navigationbar_back"] forState:UIControlStateNormal];
    
    [btn setImage:[UIImage imageNamed:@"navigationbar_back_highlighted"] forState:UIControlStateHighlighted];
    
    
    [btn addTarget:self action:@selector(backToMessage) forControlEvents:UIControlEventTouchUpInside];
    
    [btn sizeToFit];
    
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:btn];
    
    
    UIButton *btnR = [[UIButton alloc]init];
    
    [btnR setTitle:@"新建群" forState:UIControlStateNormal];
    
    [btnR setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    
    [btnR setTitleColor:[UIColor orangeColor] forState:UIControlStateHighlighted];
    
    [btnR sizeToFit];
    
    [btnR addTarget:self action:@selector(newGroup) forControlEvents:UIControlEventTouchUpInside];
    
    
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:btnR];
    
    
#pragma mark - 添加搜索栏
    UISearchBar *sb = [[UISearchBar alloc]initWithFrame:CGRectMake(0, 0, 375, 44)];
    
    sb.placeholder = @"搜索群                                                                        ";
    
    [sb setContentMode:UIViewContentModeLeft];
    
    [self.tableView addSubview:sb];
    
    
    
  
}


#pragma mark - 返回消息界面
- (void)backToMessage {
    
    
      
    [self.navigationController popViewControllerAnimated:YES];
    
}

- (void)newGroup {
    
    UITableView *view1 = [[UITableView alloc]initWithFrame:[UIScreen mainScreen].bounds];
    
    view1.backgroundColor = [UIColor grayColor];
    
    [self.view addSubview:view1];
    
    
    
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {

    return 0;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

    return 0;
}

/*
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:<#@"reuseIdentifier"#> forIndexPath:indexPath];
    
    // Configure the cell...
    
    return cell;
}
*/

/*
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
    // Return NO if you do not want the specified item to be editable.
    return YES;
}
*/

/*
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
    if (editingStyle == UITableViewCellEditingStyleDelete) {
        // Delete the row from the data source
        [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
    } else if (editingStyle == UITableViewCellEditingStyleInsert) {
        // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
    }   
}
*/

/*
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
}
*/

/*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
    // Return NO if you do not want the item to be re-orderable.
    return YES;
}
*/

/*
#pragma mark - Table view delegate

// In a xib-based application, navigation from a table can be handled in -tableView:didSelectRowAtIndexPath:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    // Navigation logic may go here, for example:
    // Create the next view controller.
    <#DetailViewController#> *detailViewController = [[<#DetailViewController#> alloc] initWithNibName:<#@"Nib name"#> bundle:nil];
    
    // Pass the selected object to the new view controller.
    
    // Push the view controller.
    [self.navigationController pushViewController:detailViewController animated:YES];
}
*/

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
